package org.csu.mypetstore.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.csu.mypetstore.api.vo.ChatUserVO;

@Data
@TableName("chatUser")
public class ChatUser {
    @TableId(value="id",type = IdType.INPUT)
    private String id;              //ID（与username一致）
    @TableField(value="displayName")
    private String displayName;     //展示的名字（与username一致）
    @TableField(value="avatar")
    private String avatar;          //头像

    public ChatUserVO toVO(ChatUser user){
        ChatUserVO vo = new ChatUserVO();
        vo.setId(user.getId());
        vo.setDisplayName(user.getDisplayName());
        vo.setAvatar(user.getAvatar());
        return vo;
    }
}
